import request from '@/utils/request'

//export表示可以被别人调用
export default {
  //添加课程基本信息
  addCourseInfo(courseInfo) {
    return request({
      url:`/eduservice/edu-course/addCourseInfo`,
      method: 'post',
      data: courseInfo
    })
  },
  //根据id查询课程基本信息
  getCourseInfo(courseId) {
    return request({
      url:`/eduservice/edu-course/getCourseInfo/${courseId}`,
      method: 'get'
    })
  },
  //修改课程信息
  updateCourseInfo(courseInfo){
    return request({
      url:`/eduservice/edu-course/updateCourseInfo`,
      method: 'post',
      data: courseInfo
    })
  },
  //课程确认信息显示
  getPublishCourseInfo(id) {
    return request({
      url: '/eduservice/edu-course/getPublishCourseInfo/'+id,
      method: 'get'
    })
  },
//课程最终发布
  publishCourse(id) {
    return request({
      url: '/eduservice/edu-course/publishCourse/'+id,
      method: 'get'
    })
  },
  //分页查询讲师列表
  getCourseList(current,limit,courseQuery) {
    return request({
      url:`/eduservice/edu-course/getCourseList/${current}/${limit}`,
      method: 'post',
      //data标识把对象转json传输
      data: courseQuery
    })
  },
  //根据id删除
  removeById(id) {
    return request({
      url: `/eduservice/edu-course/deleteById/${id}`,
      method: 'delete'
    })
  },
}
